kevinjohnson_08279
07/30/2025, 9:51 PMcomposio = Composio(api_key=api_key, provider=CrewAIProvider())
class GetTaskCommentsInput(BaseModel):
task_id: str = Field(..., description="Task ID to retrieve comments for")
@composio.tools.custom_tool(toolkit="asana")
def get_task_comments(
request: GetTaskCommentsInput,
execute_request: ExecuteRequestFn,
auth_credentials: dict,
) -> dict:
"""Gather comments for a particular task."""
res = execute_request(
endpoint=f"tasks/{request.task_id}/stories/",
method="GET"
)
return {"comments": json.dumps(res, indent=4)}
# I've tried:
tools = [get_task_comments]
tools = [composio.tools.get(user_id=user_id, tools=[get_task_comments.slug])
tools = [composio.tools.get(user_id=user_id, slug=get_task_comments.slug)
Agent(
role="",
goal="""
""",
backstory=(
""
),
verbose=True,
tools=tools,
allow_delegation=True,
llm=ChatOpenAI(model_name="gpt-4.1"),
)
However the agent can work with builtin tools but not with these custom tools. It may call them and then leave an error that the tool is not found.Composio Support Agent
07/31/2025, 4:18 AMComposio Support Agent
07/31/2025, 5:18 AMbase_url , this is how it should look like: /endpoint...
2. The Tool Slug should be ASANA_GET_TASK_COMMENTS .
3. Please pass Authorization headers. You can refer this example:
Let me know if this works.
Latest SDK version: pip install composio-crewai==0.8.5, pip install composio==0.8.5kevinjohnson_08279
07/31/2025, 1:32 PMComposio Support Agent
07/31/2025, 2:07 PMkevinjohnson_08279
07/31/2025, 2:26 PMComposio Support Agent
07/31/2025, 2:32 PMGET_TASK_COMMENTS , Could you please try ASANA_GET_TASK_COMMENTS . Also, pass the task Id as a string instead of an inteager.kevinjohnson_08279
07/31/2025, 3:25 PMkevinjohnson_08279
07/31/2025, 3:51 PMkevinjohnson_08279
07/31/2025, 4:32 PMfor key, val in composio.tools._custom_tools.custom_tools_registry.items():
val.info.slug = val.slug
val.info.name = val.name
and the second issue by injecting the user id into the parameters before the tool call.
@before_execute(tools=["ASANA_GET_TASK_COMMENTS"])
def inject_user_id(
tool: str,
toolkit: str,
params: ToolExecuteParams
) -> dict:
params['arguments']['user_id'] = params['user_id']
return paramsabhishekpatil4
07/31/2025, 6:04 PM